<%#
# To change this template, choose Tools | Templates
# and open the template in the editor.
%>

<% title "Edit #{@batch.name}", false %>

<div id="page-header">
  
  <div class="page-help-section">
    
  </div>
  <div class="page-help-navigator">
    <span id="help-button">Help</span>
  </div>
  
  <span class="page-icons page_batch_icon"></span>
  <h1 class="page-name">Add New Batch</h1>
</div>

<br/>

<div class="page-form">
  <% form_for :batch, :url => {:controller => "/admin/batches", :action => "update", :id=>@batch.id} , :html=>{:class=>'large-form'} do |f| %>
      <%= f.text_field :id, :hidden=>true %>
      <div class="form_row">
        <%= f.label :name , "Title" , :class => 'block-label'%>
        <%= f.text_field :name, :class=>"title-input" %>
      </div>
      <div class="form_row">
        <%= f.label :code , "Code" , :class => 'block-label' %>
        <%= f.text_field :code %>
      </div>
      <div class="form_row">
        <%= f.label :parent_batch_id , "Parent batch" , :class => 'block-label' %>
        <%= tree_batch_select(Batch.find(:all, :conditions => "parent_batch_id = 0"), 'batch', 'parent_batch_id', @batch) %>
      </div>
      <div class="form_row">
        <%= f.label :description , "Description" %>
        <%= f.text_area :description, :class => "mceEditor" %>
      </div>
      <div class="form_row">
        <div class="row_half float-left">
          <%= f.label :start_date , "Start date" , :class => 'block-label'%>
          <%= f.text_field :start_date , :class => 'datetype'%>
        </div>
        <div class="row_half float-right align-right">
          <%= f.label :end_date , "End date" , :class => 'block-label'%>
          <%= f.text_field :end_date , :class => 'datetype' %>
        </div>
        <div class="clear"></div>
      </div>
      <div class="form_row">
        <div class="row_half">
          <%= f.label :is_deleted , "Publish" , :class => 'block-label'%>
          <%= f.check_box :is_deleted %>
        </div>
      </div>
      <div class="form_row">
        <%= f.submit "Save changes" , :class => 'submit_button' %>
      </div>
  
  <% end %>
</div>